<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>component props</title>
  <script src="../assets/js/vue.js"></script>
</head>
<body>
  <h1>component props</h1>
  <hr>
  <div id="app">
    <panda :from-here="message" name='panda'></panda>
  </div>
  <script>
    var vue = new Vue({
      el: '#app',
      data: {
        message: 'siChuan'
      },
      components: {
        panda: {
          template: `<h3 style="color: red;">局部组件属性{{ fromHere }} - {{ name }}</h3>`,
          props: ['fromHere', 'name'], // 这里的属性是一个数组，可以有多个属性，有‘-’要用驼峰式的写法
        }
      }
    })
  </script>
</body>
</html>